<!DOCTYPE html>
<title>builderResultsTest</title>
<meta charset="utf-8">
<script src="/bower_components/webcomponentsjs/webcomponents-lite.js"></script>
<script src="/bower_components/web-component-tester/browser.js"></script>
<link rel="import" href="/elements/som-test-results/som-builder-results.html">
<test-fixture id="som-builder-results-test">
  <template>
    <som-builder-results></som-builder-results>
  </template>
</test-fixture>

<script>
  'use strict';

  suite('som-builder-results', function() {
    var element;
    setup(function() {
      element = fixture('som-builder-results-test');
      element.builderResults = {
        builder_name:'some-builder',
        total_failures: 2,
        results: [
          {build_number: 1, actual: ['PASS'], expected: ['PASS']},
          {build_number: 2, actual: ['FAIL'], expected: ['PASS']},
          {build_number: 3, actual: ['FAIL'], expected: ['PASS']},
        ],
      };
    });

    test('test getRenderedObjects', function(done) {
      flush(function() {
        let renderedObjects = element._getRenderedObjects(element.builderResults.results);
        assert.equal(renderedObjects[0].colorClass, 'pass');
        assert.equal(renderedObjects[1].colorClass, 'fail');
        assert.equal(renderedObjects[2].colorClass, 'fail');
        done();
      });
    });
  });

</script>
